package com.fau.hm.security;

import javax.annotation.Resource;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.fau.hm.entity.MedicalAdmin;
import com.fau.hm.service.IUserManagerService;


@Service
public class MyUserDetailServiceImpl implements UserDetailsService {

	private IUserManagerService iUserManagerService;
	
	@Override
	public UserDetails loadUserByUsername(String arg0)
			throws UsernameNotFoundException {
		MedicalAdmin admin = iUserManagerService.findUserByName(arg0);
		return admin;
	}

	public IUserManagerService getiUserManagerService() {
		return iUserManagerService;
	}

	@Resource
	public void setiUserManagerService(IUserManagerService iUserManagerService) {
		this.iUserManagerService = iUserManagerService;
	}

	

}
